import { nanoid } from 'nanoid'

export enum CommandState {
    WAITING = 'Waiting',
    SUCCESS = 'Success',
    FAILED = 'Failed',
}

export declare type Command = {
    id: number
    command_id: string
    name: string
    args: string
    output: string
    state: CommandState
    component: string
    statistic: string
}

export function new_command(): Command {
    return {
        id: 0,
        command_id: nanoid(),
        name: '',
        args: '',
        output: '',
        state: CommandState.WAITING,
        component: '',
        statistic: '',
    }
}
